package com.aaa.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class MyMvcConfig implements WebMvcConfigurer{
    //跨域配置
    @Override
    public void addCorsMappings(CorsRegistry registry) {
        //registry.对于那些路径 允许哪些路径的访问  .allowCredentials运训接受跨域的cookie
        registry.addMapping("/**").allowedOrigins("*").allowCredentials(true);
    }
}
